package com.wc.codeforces.贪心.Smithing_Skill;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/6/28 0:09
 * @description https://codeforces.com/contest/1989/problem/D
 */
public class Main {
    /**
     * 败到D题上面
     * 知道怎么做，但是优化不了, 奇怪了, 还是难度很大
     * 优化完成
     * 思路：
     * 1、贪心排序, 差值越小, 消耗就越小, 能得到更多的经验
     * 2、但是有一点, 需要熔铁数量大于制造所用的数量, 那使用的时候就是逐级递减的，
     * 3、那就说明是可以二分搜索
     * 4、然后就是满足2条件如何快速计算最大可使用的呢, 那就需要推导公式
     * c - (x - 1) * (a - b) >= a
     * x 表示 最大次数
     * x <= (c - a) / (a - b) + 1
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 1000010;
    static int[][] a = new int[N][2];
    static int[] f = new int[N];
    static int[] c = new int[N];
    static int[] stack = new int[N], r = new int[N];
    static int top = 0;
    static int n, m;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i][0] = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i][1] = a[i][0] - sc.nextInt();
        for (int i = 1; i <= m; i++) c[i] = sc.nextInt();
        Arrays.sort(a, 1, n + 1, ((o1, o2) -> {
            if (o1[1] == o2[1]) return o1[0] - o2[0];
            else return o1[1] - o2[1];
        }));
        long res = 0;
        a[n + 1][0] = 0;
        // 单调栈
        stack[++top] = n + 1;
        for (int i = n; i >= 1; i--) {
            while (top >= 1 && a[stack[top]][0] >= a[i][0]) top--;
            r[i] = stack[top];
            stack[++top] = i;
        }
        int j = 1, len = 0;
        while (j <= n && j != 0) {
            f[++len] = j;
            j = r[j];
        }
        f[++len] = n + 1;
        for (int i = 1; i <= m; i++) {
            j = 1;
            while (j <= len) {
                int l = j, r = len;
                while (l < r) {
                    int mid = l + r >> 1;
                    if (c[i] >= a[f[mid]][0]) r = mid;
                    else l = mid + 1;
                }
                if (l == len) break;
                j = l;
                long x = (c[i] - a[f[j]][0]) / a[f[j]][1] + 1;
                res += x * 2;
                c[i] -= x * a[f[j]][1];
                j++;
            }
        }
        out.println(res);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
